package ${pojoPackageName}.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ${pojoPackageName}.model.${pojoName};
import ${pojoPackageName}.model.${pojoName}Condition;
import ${pojoPackageName}.service.${pojoName}Service;
import ${pojoPackageName}.mapper.${pojoName}Mapper;
@Service
public class ${pojoName}ServiceImpl implements ${pojoName}Service{

    @Autowired
    private ${pojoName}Mapper ${pojoName?uncap_first}Mapper;
    @Override 
    public int save${pojoName}(${pojoName} ${pojoName?uncap_first}) throws Exception{
        return ${pojoName?uncap_first}Mapper.save${pojoName}(${pojoName?uncap_first});
    }
    @Override
    public int save${pojoName}Selective(${pojoName} ${pojoName?uncap_first}) throws Exception{
        return ${pojoName?uncap_first}Mapper.save${pojoName}Selective(${pojoName?uncap_first});
    }
    @Override
    public int saveList${pojoName}(List<${pojoName}> ${pojoName?uncap_first}List) throws Exception{
        return ${pojoName?uncap_first}Mapper.saveList${pojoName}(${pojoName?uncap_first}List);
    }
    @Override
    public int count${pojoName}Condition(${pojoName}Condition ${pojoName?uncap_first}Condition) throws Exception{
        return ${pojoName?uncap_first}Mapper.count${pojoName}Condition(${pojoName?uncap_first}Condition);
    }
    @Override
    public List<${pojoName}> list${pojoName}Condition(${pojoName}Condition ${pojoName?uncap_first}Condition) throws Exception{
        return ${pojoName?uncap_first}Mapper.list${pojoName}Condition(${pojoName?uncap_first}Condition);
    }
   
<#if javaTablePK??>
    @Override
    public int remove${pojoName}ByPrimaryKey(String ${javaTablePK}) throws Exception{
        return ${pojoName?uncap_first}Mapper.remove${pojoName}ByPrimaryKey(${javaTablePK});
    }
    @Override
    public int removeList${pojoName}ByPrimaryKey(String[] ${javaTablePK}Array) throws Exception{
        return ${pojoName?uncap_first}Mapper.removeList${pojoName}ByPrimaryKey(${javaTablePK}Array);
    }
    @Override
    public int update${pojoName}ByPrimaryKey(${pojoName} ${pojoName?uncap_first}) throws Exception{
        return ${pojoName?uncap_first}Mapper.update${pojoName}ByPrimaryKey(${pojoName?uncap_first});
    }
    @Override
    public int update${pojoName}ByPrimaryKeySelective(${pojoName} ${pojoName?uncap_first}) throws Exception{
        return ${pojoName?uncap_first}Mapper.update${pojoName}ByPrimaryKeySelective(${pojoName?uncap_first});
    }
    @Override
    public ${pojoName} get${pojoName}ByPrimaryKey(String ${javaTablePK}) throws Exception{
        return ${pojoName?uncap_first}Mapper.get${pojoName}ByPrimaryKey(${javaTablePK});
    }
 </#if>   
   public ${pojoName}Mapper get${pojoName}Mapper() {
        return ${pojoName?uncap_first}Mapper;
    }

    public void set${pojoName}Mapper(${pojoName}Mapper ${pojoName?uncap_first}Mapper) {
        this.${pojoName?uncap_first}Mapper = ${pojoName?uncap_first}Mapper;
    } 
}